import logo from '@/static/APPico.png'

function share() {
  const pages = getCurrentPages()
  let url = ''
  const page: any = pages[pages.length - 1]
  if (page) {
    url = page.route + Object.entries(page.options).map(([k, v]) => `${k}=${v}`).join('&')
  }
  return {
    path: `/pages/index/index?share=${url}`,
    title: import.meta.env.VITE_APP_TITLE,
    imageUrl: logo,
  }
}
export default {
  onShareAppMessage() {
    return share()
  },
  onShareTimeline() {
    return share()
  },
}
